-
Notifications
You must be signed in to change notification settings - Fork 393
fix background-imgae none 的编译error #2226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| return { prop, value } | ||
| } else { | ||
| error(`Value of ${prop} in ${selector} selector only support value <url()> or <linear-gradient()>, received ${value}, please check again!`) | ||
| value !== 'none' && error(`Value of ${prop} in ${selector} selector only support value <url()> or <linear-gradient()>, received ${value}, please check again!`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不应该在这里处理,应该在上面条件中识别none,并且返回none,在运行时中处理none
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
否则通过css var声明的none同样无法得到正确处理
| if (value === 'none') { | ||
| return [ | ||
| { prop: bgPropMap.image, value }, | ||
| { prop: bgPropMap.color, value: 'transparent' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不需要color吧?
| const { textStyle, backgroundStyle, innerStyle = {} } = splitStyle(normalStyle) | ||
|
|
||
| enableBackground = enableBackground || !!backgroundStyle | ||
| enableBackground = enableBackground || (!!backgroundStyle && backgroundStyle.backgroundImage !== 'none') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不应该影响enableBackground,应该在parseBgImage中修改if (!text || text==='none') return {}
No description provided.